package com.Monica.diy;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AnnotationPointCut {
    private Object proceed;

    @Before("execution(* com.Monica.Service.UserServiceImp.*(..))")
    public void before(){
        System.out.println("=======执行前======");
    }
    @After("execution(* com.Monica.Service.UserServiceImp.*(..))")
    public void after(){
        System.out.println("=======执行后======");
    }
    @Around("execution(* com.Monica.Service.UserServiceImp.*(..))")
    public void around(ProceedingJoinPoint joinPoint) throws Throwable{
        System.out.println("环绕前");

        //执行方法
        Object proceed = joinPoint.proceed();

        System.out.println("环绕后");

    }
}
